<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<script type="text/javascript">
	window.onload=function(){
	box = document.getElementsByClassName('box');
	// box[0].innerHTML="hahha";
	// alert(box);
	
	box2 = document.getElementsByClassName('box2');

		x=0;
	box[0].onclick=function(){
			// box2[0].style.display="none";
		if(x==0){
			data=box2[0].innerHTML;
			box[0].innerHTML=data;
			box2[0].style.display="none";
			x=1
		}else{
			box[0].innerHTML='';
			box2[0].style.display="block";
			x=0;
		}
			
		
	 }
	}
	</script>
	<style type="text/css">

	.box{
		width: 200px;
		height: 200px;
		background: red url() 0 0 no-repeat;
	}
	.box2{
		width: 200px;
		height: 200px;
		background: blue url() 0 0 no-repeat;
	}
	</style>
	<title>Document</title>
</head>
<body>
	<div class="box"></div>
	<div class="box2">么么么么木木木木木</div>
</body>
</html>